<template>
<div>
	<p>count:{{countObj.count}}</p>
	<p>person:{{person.name}}-{{person.addr.city}}</p>
	<button @click="update">更新</button>
</div>
</template>
<script setup>
import {ref,reactive,watch} from "vue"
const countObj=ref({
	count:0
})
const person=reactive({
	name:"张三",
	addr:{
		city:"北京"
	}
})
const update=()=>{
	countObj.value={
		count:2
	}
}
watch(countObj,(newVal,oldVal)=>{
	console.log("countObj 浅监听",newVal,oldVal)
})
</script>